var express = require('express')
var router = express.Router()
var requestHandlers = require("./requestHandlers")
var fs=require("fs")

require('./functions.js')

router.get('/', function(req, res, next) {
  res.render('index', { title: 'index' , tips: "choose a operation:"})
})

router.get('/runGame', function(req, res, next) {
    requestHandlers.getRunGame(req, res)
})

router.post('/runGame', function(req, res, next) {
    requestHandlers.postRunGame(req, res)
})

router.get('/publishGame', function(req, res, next) {
    requestHandlers.getPublishGame(req, res)
})

router.post('/publishGame', function(req, res, next) {
    requestHandlers.postPublishGame(req, res)
})

router.get('/c2js', function(req, res, next) {
    requestHandlers.getC2js(res)
})

router.get('/publishCocos', function(req, res, next) {
    requestHandlers.getPublishCocos(res)
})

router.get('/publishGameFrame', function(req, res, next) {
    requestHandlers.getPublishGameFrame(res)
})


module.exports = router
